﻿@model IEnumerable<WriterStars.Models.ViewModels.BookViewModel>
@using Microsoft.AspNet.Identity
@{
    var books = Model.ToList();
    int contestId = ViewBag.ContestId ?? 0;
    string currentUserId = User.Identity.GetUserId();
}

<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
    @if (this.ViewBag.WriteMore == true)
    {
        <a href="/book/publish">
            <div class="new-book">
                <i class="fa fa-plus fa-lg cross"></i>
            </div>
            <div class="new-book-info">
                Write more ...
            </div>
        </a>
    }
    @for (int i = 0; i < books.Count; i += 4)
    {
        @Html.Partial("_BookPreview", books[i])
    }
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
    @for (int i = 1; i < books.Count; i += 4)
    {
        @Html.Partial("_BookPreview", books[i])
    }
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
    @for (int i = 2; i < books.Count; i += 4)
    {
        @Html.Partial("_BookPreview", books[i])
    }
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
    @for (int i = 3; i < books.Count; i += 4)
    {
        @Html.Partial("_BookPreview", books[i])
    }
</div>